package com.itheima.service.impl.rabbitmq.direct.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;

/**
 * ClassName: RabbitConfigDirect
 * Description:
 * Date: 2023/03/19 AM 10:51:56
 * <p>
 * project: springboot
 * package: com.itheima.service.impl.rabbitmq.direct.config
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
// @Configuration
public class RabbitConfigDirect {

    @Bean
    public Queue directQueue() {
        return new Queue("direct_queue");
    }

    @Bean
    public Queue directQueue2() {
        return new Queue("direct_queue2");
    }

    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange("directExchange");
    }

    @Bean
    public DirectExchange directExchange2() {
        return new DirectExchange("directExchange2");
    }

    @Bean
    public Binding bindingDirect() {
        return BindingBuilder.bind(directQueue()).to(directExchange()).with("direct");
    }

    @Bean
    public Binding bindingDirect2() {
        return BindingBuilder.bind(directQueue2()).to(directExchange2()).with("direct2");
    }
}
